package com.blog.service;

import com.blog.dto.FavoriteDTO;
import com.blog.pojo.Articles;
import com.blog.pojo.Favorite;
import com.blog.pojo.Start;

import java.util.List;

public interface ArticleService {
    //添加
    public Articles addArticle(Articles articles);
    //删除
    public boolean delete(int id);
    //修改
    public boolean update(Articles articles);
     //查询--作者
    public List<Articles> findByAuthor(String  author);
     //查找--title
    public Articles findByTitle(String title);
     //查找--全部
    public List<Articles> findAll();

    public Articles findById(int id);
    //查询--用户id
    public List<Articles> finbByUserId(int userId);
    //查询--用户id和状态
    public List<Articles> findByUserIdAndStatus(int userId, byte status);


    public boolean deleteStart(int articleId, int userId);

    public Start addStart(Start start);

    public long findStartCount(int articleId);

    public Favorite addFavorite(Favorite favorite);

    public boolean deleteFavorite(int articleId, int userId);

    public long findFavoriteCount(int articleId);



    //查询--文章+点赞+用户
    public boolean findStart(int articleId, int userId, Byte start);

    //查询--文章+收藏+用户
    public boolean findFavorite(int userId , int articleId, Byte favorite);



    public boolean updateStartCount(int articleId, long startCount);
    public boolean updateFavoriteCount(int articleId, long favoriteCount);


    public boolean userLiked(int articleId, int userId);
    public boolean userFavorited(int articleId, int userId);

    public List<Favorite> findFavoriteList(int userId);

    public List<Start> userLikedArticles(int userId, List<Integer> articleIds);


}
